package com.ityunhe.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.ityunhe.bean.Car;
import com.ityunhe.dao.CarDao;
import com.ityunhe.factory.MybatisUtil;

public class CarDaoImpl implements CarDao {

	@Override
	public int saveCar(Car car) {
		int saveCar=0;
		SqlSession session = MybatisUtil.getSession();
		try {
			
			CarDao mapper = session.getMapper(CarDao.class);
			saveCar = mapper.saveCar(car);
			session.commit();
		} catch (Exception e) {
			
			e.printStackTrace();
		}finally{
			MybatisUtil.closeSession();
		}
		return saveCar;
	}

	@Override
	public int remove(Car car) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(Car car) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Car getCar(Car car) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Car> listCar() {
		// TODO Auto-generated method stub
		return null;
	}

}
